<script setup lang="ts">
import { defineAsyncComponent } from 'vue'
import { loadRemote } from '@module-federation/runtime'

const props = defineProps<{
  remoteName: string
  componentName: string
}>()
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-expect-error
const RemoteComponent = defineAsyncComponent(() =>
  loadRemote(`${props.remoteName}/${props.componentName}`),
)
</script>

<template>
  <RemoteComponent v-bind="$attrs" />
</template>
